<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/mui.picker.min.css" />
		<script src="../js/mui.min.js"></script>
		<script src="../js/mui.picker.min.js"></script>
		<style>
			span{float:left; padding:0 5px;}
			.bottom{ width: 80%;margin-top: 20px; margin-left: 10%; line-height:30px; background-color: #0284B8; color:#FFFFFF;}
			.mui-query-admin ul{width:80%; margin:0 10%; padding: 0;}
			.mui-query-admin ul li{width:100%; border-bottom: 1px solid #BBBBBB; margin-top:20px;}
			.mui-query-admin ul li span{ float: left; width:70px; text-align:left; line-height: 40px;}
			.mui-table-view{ background-color:#efeff4; border:none;}
			.mui-query-admin ul li{list-style:none;}
			input[type=text],input[type=number]{
				border-width:0;
				margin-bottom:0;
				background:none;
			}
			.mui-span{}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title" id="muititle">档案查询</h1>
		</header>
		<div class="mui-conten mui-query-admin" style="margin-top:60px;">
			<ul class="mui-query-admin">
				<li><span class="mui-span">身份证</span><input id="idCard" type="number" style="width:180px; margin-left:5px; padding: 0;" placeholder="输入身份证"></li>
				<li><span class="mui-span">医保号</span><input id="nhCode" type="text" onkeyup="this.value=this.value.replace(/[^\w_]/g,'');" style="width:180px; margin-left:5px; padding: 0;" placeholder="输入医保"></li>
				<li><span class="mui-span">姓名</span><input id="patname" type="text" style="width:180px; margin-left:5px; padding: 0;" placeholder="输入姓名"></li>
			</ul>
			<button class="bottom" id="bottom">下一步</button>
		</div>
		<script src="../js/mui.js"></script>
		<script type="text/javascript">
			mui.init();
			var docdata = localStorage.getItem("name")
			var dataold = JSON.parse(docdata)
			var headname;
			mui.plusReady(function(){
				var self = plus.webview.currentWebview()
				headname = self.name;
				console.log(headname)
			})
			document.getElementById("bottom").addEventListener("tap",function(){
				var hospId = dataold.obj.hospId;
				var regionId = dataold.obj.regionId;
				var queryname = headname;
				var idCard = document.getElementById("idCard").value;
				var nhCode = document.getElementById("nhCode").value;
				var patname = document.getElementById("patname").value;
				var pageIndex = "1";
				var pageSize = "5";
				if (idCard == "" && nhCode == "" && patname == "") {
					alert("请输入一项查询内容！");
				}else {
					if(headname == "基本信息"){
						mui.openWindow({
							url: 'list_archives.html', 
							id:'list_archives',
							extras:{
								name:queryname,
								hospId:hospId,
								regionId:regionId,
								idCard:idCard,
								nhCode:nhCode,
								patname:patname,
								pageIndex:pageIndex,
								pageSize:pageSize
							}
						});
					}else{
						mui.openWindow({
							url: 'list.html', 
							id:'list',
							extras:{
								name:queryname,
								hospId:hospId,
								regionId:regionId,
								idCard:idCard,
								nhCode:nhCode,
								patname:patname,
								pageIndex:pageIndex,
								pageSize:pageSize
							}
						});
					}
				}
			})
		</script>
	</body>
</html>